<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>emp-toolkit: /Users/wangxiao/git/emp-toolkit/emp-tool/garble/block.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo-full-doxygen.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">emp-toolkit
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('garble_2block_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">block.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="garble_2block_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef LIBGARBLE_BLOCK_H</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define LIBGARBLE_BLOCK_H</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;wmmintrin.h&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;emmintrin.h&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;xmmintrin.h&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno"><a class="line" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">    8</a></span>&#160;<span class="keyword">typedef</span> __m128i <a class="code" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a>;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno"><a class="line" href="garble_2block_8h.html#ad6447e1e625ffefda7dc7f4ef0c44be2">   10</a></span>&#160;<span class="preprocessor">#define garble_xor(x,y) _mm_xor_si128(x,y)</span></div><div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="garble_2block_8h.html#a689895f62eeb101fdda55f78eb64f321">   11</a></span>&#160;<span class="preprocessor">#define garble_zero_block() _mm_setzero_si128()</span></div><div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="garble_2block_8h.html#aaba20a9be509e35b1ecaef329d3ce3fe">   12</a></span>&#160;<span class="preprocessor">#define garble_equal(x,y) (_mm_movemask_epi8(_mm_cmpeq_epi8(x,y)) == 0xffff)</span></div><div class="line"><a name="l00013"></a><span class="lineno"><a class="line" href="garble_2block_8h.html#a0697b4b2d72c6b909475f470b97355b5">   13</a></span>&#160;<span class="preprocessor">#define garble_unequal(x,y) (_mm_movemask_epi8(_mm_cmpeq_epi8(x,y)) != 0xffff)</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="garble_2block_8h.html#a9417de4be4701bd27d52e89a0ceeac89">   15</a></span>&#160;<span class="preprocessor">#define garble_lsb(x) (*((char *) &amp;x) &amp; 1)</span></div><div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="garble_2block_8h.html#a877d2c3b464beb1bb40d5db7f71df6d9">   16</a></span>&#160;<span class="preprocessor">#define garble_make_block(X,Y) _mm_set_epi64((__m64)(X), (__m64)(Y))</span></div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="garble_2block_8h.html#a5e8e50bd0f3c713be61a20f336e5b013">   17</a></span>&#160;<span class="preprocessor">#define garble_double(B) _mm_slli_epi64(B,1)</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;stdio.h&gt;</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<a class="code" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<a class="code" href="garble_2block_8h.html#a9fb9a79c32958375aa8573e0bf37bcf6">garble_seed</a>(<a class="code" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> *seed);</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<a class="code" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<a class="code" href="garble_2block_8h.html#a239be51068ea751dc159d331e9339360">garble_random_block</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<a class="code" href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a> *</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<a class="code" href="garble_2block_8h.html#a895bc02edcaa0a0798728f538af35eb5">garble_allocate_blocks</a>(<span class="keywordtype">size_t</span> nblocks);</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="keywordtype">int</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<a class="code" href="garble_2block_8h.html#ada4e63a00b5261d51014bef55489056c">block_vfprintf</a>(FILE *stream, <span class="keyword">const</span> <span class="keywordtype">char</span> *format, va_list ap);</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="keywordtype">int</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<a class="code" href="garble_2block_8h.html#a05364853a9dfb7c2d9658d7d1a630b83">block_fprintf</a>(FILE *stream, <span class="keyword">const</span> <span class="keywordtype">char</span> *format, ...);</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="keywordtype">int</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<a class="code" href="garble_2block_8h.html#a29c4a93cc8ef9c33505fc697e80f7ffd">block_printf</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *format, ...);</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="garble_2block_8h_html_a65abbf31b0a30290189cdb5059b5f785"><div class="ttname"><a href="garble_2block_8h.html#a65abbf31b0a30290189cdb5059b5f785">block</a></div><div class="ttdeci">__m128i block</div><div class="ttdef"><b>Definition:</b> block.h:8</div></div>
<div class="ttc" id="garble_2block_8h_html_a29c4a93cc8ef9c33505fc697e80f7ffd"><div class="ttname"><a href="garble_2block_8h.html#a29c4a93cc8ef9c33505fc697e80f7ffd">block_printf</a></div><div class="ttdeci">int block_printf(const char *format,...)</div></div>
<div class="ttc" id="garble_2block_8h_html_a239be51068ea751dc159d331e9339360"><div class="ttname"><a href="garble_2block_8h.html#a239be51068ea751dc159d331e9339360">garble_random_block</a></div><div class="ttdeci">block garble_random_block(void)</div></div>
<div class="ttc" id="garble_2block_8h_html_a05364853a9dfb7c2d9658d7d1a630b83"><div class="ttname"><a href="garble_2block_8h.html#a05364853a9dfb7c2d9658d7d1a630b83">block_fprintf</a></div><div class="ttdeci">int block_fprintf(FILE *stream, const char *format,...)</div></div>
<div class="ttc" id="garble_2block_8h_html_ada4e63a00b5261d51014bef55489056c"><div class="ttname"><a href="garble_2block_8h.html#ada4e63a00b5261d51014bef55489056c">block_vfprintf</a></div><div class="ttdeci">int block_vfprintf(FILE *stream, const char *format, va_list ap)</div></div>
<div class="ttc" id="garble_2block_8h_html_a895bc02edcaa0a0798728f538af35eb5"><div class="ttname"><a href="garble_2block_8h.html#a895bc02edcaa0a0798728f538af35eb5">garble_allocate_blocks</a></div><div class="ttdeci">block * garble_allocate_blocks(size_t nblocks)</div></div>
<div class="ttc" id="garble_2block_8h_html_a9fb9a79c32958375aa8573e0bf37bcf6"><div class="ttname"><a href="garble_2block_8h.html#a9fb9a79c32958375aa8573e0bf37bcf6">garble_seed</a></div><div class="ttdeci">block garble_seed(block *seed)</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_eec959d81771dc8b1a750b834e1341eb.html">emp-tool</a></li><li class="navelem"><a class="el" href="dir_c655749829cb727292045fefce142869.html">garble</a></li><li class="navelem"><a class="el" href="garble_2block_8h.html">block.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.12 </li>
  </ul>
</div>
</body>
</html>
